//
//  main.cpp
//  L17FileSystem
//
//  Created by ai-nixs on 2017/10/29.
//  Copyright © 2017年 nixinsheng. All rights reserved.
//

#include <iostream>
#include <fstream>
using namespace std;
#include <sstream>


int main(int argc, const char * argv[]) {
    
    ofstream of("data.txt");
    //重载运算符<<
    of<<"Hello,World"<<endl;
    of.close();//关闭
    
    ifstream inf("data.txt");
    /*
    char c;
    inf>>c;////重载运算符>>
    cout<<c<<endl;
    */
    stringbuf sb;
    inf>>&sb;
    cout<<sb.str()<<endl;
    
    return 0;
}
